<script setup>
  import { ref } from 'vue'
  const list = ref([])
  for (let i = 0; i < 100; i++) {
    list.value.push({ id: i, name: '张三' + i })
  }

  uni.$on('test-enventchannle-list', (listlist) => {
    const res = list.value.find((v) => {
      return v.id === listlist.id
    })
    console.log(res, listlist)
    Object.assign(res, listlist)
  })
  const toedit = (id) => {
    uni.navigateTo({
      url: '/pages/test-enventchannle-edit/test-enventchannle-edit?id=' + id,
    })
  }
</script>
<template>
  <view v-for="(item, index) in list" :key="item.id">
    {{ item.name }}
    <button @click="toedit(item.id)">编辑</button>
  </view>
</template>

<style></style>
